﻿Public Class frmMain

    Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Panel1.Enabled = False

        Dim tab As TabPage = New TabPage()
        TabControl1.Controls.Add(tab)
        tab.Text = "Đăng nhập"

        Dim ctr As ctrDangNhap = New ctrDangNhap()
        tab.Controls.Add(ctr)
        ctr.Dock = DockStyle.Fill

    End Sub

    Private Sub btnQuanLy_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQuanLy.Click
        'effect
        btnQuanLy.ForeColor = Color.White
        btnQuanLy.BackColor = Color.Maroon
        btnDuLieu.ForeColor = Color.Maroon
        btnDuLieu.BackColor = Color.White
        btnHeThong.ForeColor = Color.Maroon
        btnHeThong.BackColor = Color.White
        btnThongTin.ForeColor = Color.Maroon
        btnThongTin.BackColor = Color.White

        Panel2.Controls.Clear()
        Panel3.Controls.Clear()
        Dim ctr As ctrQuanLy = New ctrQuanLy()
        Panel2.Controls.Add(ctr)
        ctr.Dock = DockStyle.Fill
    End Sub

    Private Sub btnDangNhap_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDangNhap.Click
        'effect
        btnDuLieu.ForeColor = Color.Maroon
        btnDuLieu.BackColor = Color.White
        btnQuanLy.ForeColor = Color.Maroon
        btnQuanLy.BackColor = Color.White
        btnHeThong.ForeColor = Color.Maroon
        btnHeThong.BackColor = Color.White
        btnThongTin.ForeColor = Color.Maroon
        btnThongTin.BackColor = Color.White

        Panel2.Controls.Clear()
        Panel3.Controls.Clear()
        TabControl1.Controls.Clear()
        btnDangNhap.Text = "Đăng nhập"
        frmMain_Load(sender, e)

        lbUser.Text = ""
        lbType.Text = ""
    End Sub

    Private Sub btnDuLieu_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDuLieu.Click
        'effect
        btnDuLieu.ForeColor = Color.White
        btnDuLieu.BackColor = Color.Maroon
        btnQuanLy.ForeColor = Color.Maroon
        btnQuanLy.BackColor = Color.White
        btnHeThong.ForeColor = Color.Maroon
        btnHeThong.BackColor = Color.White
        btnThongTin.ForeColor = Color.Maroon
        btnThongTin.BackColor = Color.White

        Panel2.Controls.Clear()
        Panel3.Controls.Clear()
        Dim ctr As ctrDuLieu = New ctrDuLieu()
        Panel2.Controls.Add(ctr)
        ctr.Dock = DockStyle.Fill
    End Sub

    Private Sub btnHeThong_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHeThong.Click
        'effect
        btnHeThong.ForeColor = Color.White
        btnHeThong.BackColor = Color.Maroon
        btnQuanLy.ForeColor = Color.Maroon
        btnQuanLy.BackColor = Color.White
        btnDuLieu.ForeColor = Color.Maroon
        btnDuLieu.BackColor = Color.White
        btnThongTin.ForeColor = Color.Maroon
        btnThongTin.BackColor = Color.White

        Panel2.Controls.Clear()
        Panel3.Controls.Clear()
        Dim ctr As ctrHeThong = New ctrHeThong()
        Panel2.Controls.Add(ctr)
        ctr.Dock = DockStyle.Fill
    End Sub

    Private Sub btnThongTin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnThongTin.Click
        'effect
        btnThongTin.ForeColor = Color.White
        btnThongTin.BackColor = Color.Maroon
        btnQuanLy.ForeColor = Color.Maroon
        btnQuanLy.BackColor = Color.White
        btnDuLieu.ForeColor = Color.Maroon
        btnDuLieu.BackColor = Color.White
        btnHeThong.ForeColor = Color.Maroon
        btnHeThong.BackColor = Color.White

        Panel2.Controls.Clear()
        Panel3.Controls.Clear()
        Dim ctr As ctrThongTin = New ctrThongTin()
        Panel2.Controls.Add(ctr)
        ctr.Dock = DockStyle.Fill
    End Sub

End Class
